package com.cxm.qyyz;


import android.text.TextUtils;

import androidx.core.app.NotificationManagerCompat;

import com.cxm.qyyz.app.App;
import com.cxm.qyyz.core.DataManager;
import com.cxm.qyyz.core.http.DefaultObserver;
import com.cxm.qyyz.core.http.RxUtil;
import com.cxm.qyyz.utils.FormatUtil;
import com.cxm.qyyz.utils.Util;
import com.cxm.qyyz.utils.flow.LogUtils;
import com.luck.picture.lib.tools.SPUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Set;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.schedulers.Schedulers;

public class SPManager {

    private static final String SWITCH_PERMISSION = "SWITCH_PERMISSION_NEW";
    private static final String SWITCH_BOX = "SWITCH_BOX";
    private static final String ARS= "ARS";
    private static final String SWITCH_WISH = "SWITCH_WISH";      //优惠券开关
    private static final String SWITCH_SECKILL = "SWITCH_SECKILL";   //秒杀活动开关
    private static final String SWITCH_SURPRISED = "SWITCH_SURPRISED"; //惊喜盲盒开关
    private static final String SWITCH_PICKED = "SWITCH_PICKED";    //重抽卡开关
    private static final String SWITCH_SIGN = "SWITCH_SIGN";      //寻宝开关
    private static final String SWITCH_COUPON = "SWITCH_COUPON";    //优惠券开关
    private static final String SURPRISED_SHARE_IMAGS = "SURPRISED_SHARE_IMAGS";    //免费分享地址
    private static final String SHARE_SECKILL_IMAGS = "SHARE_SECKILL_IMAGS";    //分享秒杀地址
    private static final String CARD_EMPTY_IMAGES = "CARD_EMPTY_IMAGES";    //重抽卡-无卡片背景图
    private static final String COUPON_EMPTY_IMAGES = "COUPON_EMPTY_IMAGES";    //暂无优惠券-背景图
    private static final String SIGN_EMPTY_IMAGES = "SIGN_EMPTY_IMAGES";    //每日寻宝-未达到铂金等级时，显示公告弹窗-背景图

    private static final String INIT_RE_YUN = "INIT_RE_YUN";
    private static final String DEBUG_OR_RELEASE = "DEBUG_OR_RELEASE";  //切换正式预生产

    public static final String DEMO_NUMBER = "DEMO_NUMBER";
    private static final String DEMO_TIME = "DEMO_TIME";
    private static final String DEMO_ALL_NUMBER = "DEMO_ALL_NUMBER";
    private static final String INIT_RE_YUN_T = "INIT_RE_YUN_T";
    private static final String PUSH_STATE = "PUSH_STATE";
    private static final String FIRST_OPEN_APP = "FIRST_OPEN_APP";
    private static final String FIRST_DOWN_MUSIC = "FIRST_DOWN_MUSIC";
    private static final String LIMIT_PRICE = "LIMIT_PRICE";
    private static final String HOME_MUSIC_PATH = "HOME_MUSIC_PATH";
    private static final String HUA_WEI_RULE = "HUA_WEI_RULE";
    private static final String SPMANAGER_LOGIN_FIRST = "SPMANAGER_LOGIN_FIRST";
    private static final String LIMIT_BOX_MONEY = "LIMIT_BOX_MONEY";//价格上限
    private static final String SWITCH_WISH_IMAGE = "SWITCH_WISH_IMAGE";//半屏广告地址

    private static final String  WAITING_PAY_TIME = "WAITING_PAY_TIME";//等待时间
    private static final String  PINK_AGE_TEXT = "PINK_AGE_TEXT";//免运费文案
    private static final String  HUA_WEI_TIME = "HUA_WEI_TIME";//华为时间限制
    private static final String  GROUP_BOOKING_RULE = "GROUP_BOOKING_RULE";//华为时间限制

    private static final String  SWITCH_LEVEL = "SWITCH_LEVEL_";//福利开关
    private static final String  SWITCH_WXFL = "SWITCH_WXFL_";//微信福利开关
    private static final String  SWITCH_MUSIC = "SWITCH_MUSIC";//背景音乐开关
    private static final String  SWITCH_VIDEO = "SWITCH_VIDEO";//新手引导视频开关
    private static final String  WXFL_URL = "WXFL_URL_";//微信福利官
    private static final String  DAILY_ACTIVITY_SWITCH = "DAILY_ACTIVITY_SWITCH";//每日活动开关
    private static final String  IS_FIRST_SHOW_FB_DIALOG = "IS_FIRST_SHOW_FB_DIALOG";//是否弹出兑换弹框
    private static final String  FIRST_LOGIN_TIME_BY_TODAY = "FIRST_LOGIN_TIME_BY_TODAY";//当天第一次登录,薅羊毛
    private static final String  IS_AUTO_SHOW_NEW_PLAYER_GIFT = "IS_AUTO_SHOW_NEW_PLAYER_GIFT";//是否自动弹窗新手礼盒
    private static final String SYSTEM_NOTICE_TIME = "SYSTEM_NOTICE_TIME";//首页系统公告弹窗时间
    private static final String ALL_MONEY_RETURN_INFO = "ALL_MONEY_RETURN_INFO";//全额返信息
    private static final String ALL_MONEY_RETURN_TIME = "ALL_MONEY_RETURN_TIME";//全额返弹窗时间
    private static final String NEW_PLAYER_GIFT_TIME = "NEW_PLAYER_GIFT_TIME";//新手礼盒弹窗时间
    private static final String IS_GROUP_BOOKING_COUNTDOWN_ANIM = "IS_GROUP_BOOKING_COUNTDOWN_ANIM";//是否开启拼团倒计时动画
    private static final String IS_ENABLE_LUCKY_ROULETTE = "IS_ENABLE_LUCKY_ROULETTE";//是否启用幸运大转盘
    private static final String IS_ENABLE_TASK_CENTER = "IS_ENABLE_TASK_CENTER";//是否启用任务中心
    private static final String IS_ENABLE_EXCHANGE_COUPON = "IS_ENABLE_CHANGE_COUPON";//是否启用兑换神券
    private static final String SYSTEM_CONFIG_INFO = "SYSTEM_CONFIG_INFO";//系统配置信息
    private static final String IS_FIRST_PLAY_MUSIC = "IS_FIRST_PLAY_MUSIC";//是否第一次播放音乐
    private static final String IS_CURRENT_DAY = "IS_CURRENT_DAY";//是否当天
    private static final String RESOURCE_FILE_INFO = "RESOURCE_FILE_INFO";//资源文件信息

    private static final String SWITCH_REPLACEMENT = "SWITCHREPLACEMENT";//资源文件信息


    /**
     * 设置 SWITCHREPLACEMENT
     * @param switch_replacement
     */
    public static void setSwitchReplacement(boolean switch_replacement){
        SPUtils.getInstance().put(SWITCH_REPLACEMENT,switch_replacement,true);
    }

    public static boolean getSwitchReplacement(){
        return SPUtils.getInstance().getBoolean(SWITCH_REPLACEMENT,false);
    }
    /**
     * 设置Ars
     * @param ars
     */
    public static void setArs(String ars){
        SPUtils.getInstance().put(ARS,ars,true);
    }

    public static String getArs(){
        return SPUtils.getInstance().getString(ARS,"09Of2odmpwWfF!202mpqacx6z123fPXOab5");
    }

    public static boolean isFirstPlayMusic(){
        boolean isFirst = SPUtils.getInstance().getBoolean(IS_FIRST_PLAY_MUSIC, true);
        SPUtils.getInstance().put(IS_FIRST_PLAY_MUSIC,false,true);
        return isFirst;
    }


    public static void setDebugOrRelease(boolean debugOrRelease){
        SPUtils.getInstance().put(DEBUG_OR_RELEASE,debugOrRelease,true);
    }
    public static boolean getDebugOrRelease(){
        return SPUtils.getInstance().getBoolean(DEBUG_OR_RELEASE,false);
    }

    public static void setSwitchPermission(boolean isEnableLuckyRoulette){
        SPUtils.getInstance().put(SWITCH_PERMISSION,isEnableLuckyRoulette,true);
    }
    public static boolean getSwitchPermission(){
        return SPUtils.getInstance().getBoolean(SWITCH_PERMISSION,false);
    }
    public static void setIsEnableLuckyRoulette(boolean isEnableLuckyRoulette){
        SPUtils.getInstance().put(IS_ENABLE_LUCKY_ROULETTE,isEnableLuckyRoulette,true);
    }

    public static boolean getIsEnableLuckyRoulette() {
        return SPUtils.getInstance().getBoolean(IS_ENABLE_LUCKY_ROULETTE,false);
    }

    public static void setIsEnableTaskCenter(boolean isEnableTaskCenter){
        SPUtils.getInstance().put(IS_ENABLE_TASK_CENTER,isEnableTaskCenter,true);
    }

    public static boolean getIsEnableTaskCenter() {
        return SPUtils.getInstance().getBoolean(IS_ENABLE_TASK_CENTER,false);
    }

    public static void setIsEnableExchangeCoupon(boolean isEnableTaskCenter){
        SPUtils.getInstance().put(IS_ENABLE_EXCHANGE_COUPON,isEnableTaskCenter,true);
    }

    public static boolean getIsEnableExchangeCoupon() {
        return SPUtils.getInstance().getBoolean(IS_ENABLE_EXCHANGE_COUPON,false);
    }

    public static void setIsGroupBookingCountdownAnim(String roomNum){
        ArrayList<String> list = getIsGroupBookingCountdownAnim();
        Set<String> info = new LinkedHashSet<>(list);
        info.add(roomNum);
        SPUtils.getInstance().put(IS_GROUP_BOOKING_COUNTDOWN_ANIM, info, true);
    }

    public static ArrayList<String> getIsGroupBookingCountdownAnim() {
        Set<String> stringSet = SPUtils.getInstance().getStringSet(IS_GROUP_BOOKING_COUNTDOWN_ANIM);
        return new ArrayList<>(stringSet);
    }

    public static boolean isPopNewPlayerGiftDialog(){
        long popTime = SPUtils.getInstance().getLong(NEW_PLAYER_GIFT_TIME, 0);
        long currentTimeMillis = System.currentTimeMillis();
        if (popTime > 0 && (currentTimeMillis - popTime) / 1000 > 5 * 60) {
            return true;
        }
        return false;
    }

    public static void setSystemNoticeTime(){
        long currentTimeMillis = System.currentTimeMillis();
        SPUtils.getInstance().put(SYSTEM_NOTICE_TIME, currentTimeMillis, true);
    }

    public static long getSystemNoticeTime() {
        return SPUtils.getInstance().getLong(SYSTEM_NOTICE_TIME, 0);
    }

    public static void setAllMoneyReturnTime(){
        long currentTimeMillis = System.currentTimeMillis();
        SPUtils.getInstance().put(ALL_MONEY_RETURN_TIME, currentTimeMillis, true);
    }

    public static long getAllMoneyReturnTime() {
        return SPUtils.getInstance().getLong(ALL_MONEY_RETURN_TIME, 0);
    }

    public static void setIsAutoShowNewPlayerGift(boolean isShow) {
        SPUtils.getInstance().put(IS_AUTO_SHOW_NEW_PLAYER_GIFT, isShow, true);
    }

    public static boolean getIsAutoShowNewPlayerGift() {
        return SPUtils.getInstance().getBoolean(IS_AUTO_SHOW_NEW_PLAYER_GIFT,true);
    }

    public static void setFirstLoginTimeByToday(){
        if (getFirstLoginTimeByToday() == 0) {
            SPUtils.getInstance().put(FIRST_LOGIN_TIME_BY_TODAY, System.currentTimeMillis(), true);
        }else {
            boolean sameOfDay = Util.isSameOfDay(System.currentTimeMillis(), getFirstLoginTimeByToday());
            if (!sameOfDay) {
                setIsAutoShowNewPlayerGift(true);
                SPUtils.getInstance().put(FIRST_LOGIN_TIME_BY_TODAY, System.currentTimeMillis(), true);
            }
        }
    }

    public static long getFirstLoginTimeByToday(){
        return SPUtils.getInstance().getLong(FIRST_LOGIN_TIME_BY_TODAY,0);
    }

    public static long getNewPlayerGiftCountdownTime(long endTimeSec){
        long newPlayerEndTime = getFirstLoginTimeByToday() + endTimeSec * 1000L;
        return newPlayerEndTime - System.currentTimeMillis();
    }

    /**
     *  是否弹出兑换弹框
     */
    public static void setShowFBDialog() {
        SPUtils.getInstance().put(IS_FIRST_SHOW_FB_DIALOG, true, true);
    }

    /**
     * 是否弹出兑换弹框
     * @return
     */
    public static boolean getShowFBDialog() {
        return !SPUtils.getInstance().getBoolean(IS_FIRST_SHOW_FB_DIALOG, false) && UserManager.getInstance().getUser().getPromotionChannel().equals("tuia");
    }
    /**
     *  设置福利开关
     * @param switchLevel
     */
    public static void setSwitchLevel(boolean switchLevel) {
        SPUtils.getInstance().put(SWITCH_LEVEL, switchLevel, true);
    }

    /**
     * 获取福利开关
     * @return
     */
    public static boolean getSwitchLevel() {
        return SPUtils.getInstance().getBoolean(SWITCH_LEVEL, false);
    }

    /**
     * 设置微信福利开关
     * @param switchWxfl
     */
    public static void setSwitchWxfl(boolean switchWxfl) {
        SPUtils.getInstance().put(SWITCH_WXFL, switchWxfl, true);
    }

    /**
     * 获取开关
     * @return
     */
    public static boolean getSwitchWxfl() {
        return SPUtils.getInstance().getBoolean(SWITCH_WXFL, false);
    }

    /**
     * 获取微信福利url
     */
    public static void setWxflUrl(String switchWxfl) {
        SPUtils.getInstance().put(WXFL_URL, switchWxfl, true);
    }

    /**
     * 设置微信福利url
     */
    public static String getWxflUrl() {
        return SPUtils.getInstance().getString(WXFL_URL, "");
    }

    public static void setSwitchMusic(boolean isMusic){
        SPUtils.getInstance().put(SWITCH_MUSIC, isMusic, true);
    }

    public static boolean getSwitchMusic() {
        return SPUtils.getInstance().getBoolean(SWITCH_MUSIC, false);
    }

    public static void setSwitchVideo(boolean isVideo){
        SPUtils.getInstance().put(SWITCH_VIDEO, isVideo, true);
    }

    public static boolean getSwitchVideo() {
        return SPUtils.getInstance().getBoolean(SWITCH_VIDEO, false);
    }

    /**
     * 设置全额返数据
     */
    public static void setFullReturnInfo(String imgUrl,String fullReturnJumpBoxId) {
        Set<String> info = new LinkedHashSet<>();
        info.add(imgUrl);
        info.add(fullReturnJumpBoxId);
        SPUtils.getInstance().put(ALL_MONEY_RETURN_INFO, info, true);
    }

    /**
     * 获取全额返数据
     */
    public static Set<String> getFullReturnInfo() {
        return SPUtils.getInstance().getStringSet(ALL_MONEY_RETURN_INFO);
    }

    /**
     * 设置每日活动开关
     */
    public static void setDailyActivitySwitch(String turn) {
        SPUtils.getInstance().put(DAILY_ACTIVITY_SWITCH, "1".equals(turn), true);
    }

    /**
     * 获取每日活动开关
     */
    public static boolean getDailyActivitySwitch() {
        return SPUtils.getInstance().getBoolean(DAILY_ACTIVITY_SWITCH,false);
    }

    /**
     * 获取能否继续试玩
     *
     * @return true 可以 false  不能继续试玩
     */
    public static boolean getDemo() {
        int anInt = SPUtils.getInstance().getInt(DEMO_ALL_NUMBER, 1000);
        LogUtils.d("试玩总次数 -- " + anInt + " -- 试玩次数" + SPUtils.getInstance().getInt(DEMO_NUMBER));
        return SPUtils.getInstance().getInt(DEMO_NUMBER) < anInt;
    }


    //设置试玩次数
    public static void setDemoNumber() {
        String string = SPUtils.getInstance().getString(DEMO_TIME);
        String ymd = FormatUtil.getYMD();
        if (string.equals(ymd)) {
            int anInt = SPUtils.getInstance().getInt(DEMO_NUMBER);
            SPUtils.getInstance().put(DEMO_NUMBER, anInt + 1, true);
        } else {
            SPUtils.getInstance().put(DEMO_TIME, ymd, true);
            SPUtils.getInstance().put(DEMO_NUMBER, 1, true);
        }
    }

    /**
     * 更换手机号的时候 从0开始
     */
    public static void clearNumber() {
        SPUtils.getInstance().put(DEMO_NUMBER, 0, true);
    }

    public static void setDemoAllNumber(int number) {
        SPUtils.getInstance().put(DEMO_ALL_NUMBER, number, true);
    }

    public static void setOAId(String ovId) {
        SPUtils.getInstance().put(INIT_RE_YUN, ovId, true);
    }

    public static String getOAId() {
        return SPUtils.getInstance().getString(INIT_RE_YUN, "");
    }


    /**
     * 拼团规则
     */
    public static void setGroupBookingRule(String imgUrl) {
        SPUtils.getInstance().put(GROUP_BOOKING_RULE, imgUrl, true);
    }
    /**
     * 拼团规则
     */
    public static String getGroupBookingRule() {
        return SPUtils.getInstance().getString(GROUP_BOOKING_RULE, "");
    }

    /**
     * 保存半屏广告地址
     * @param pinkAgeText
     */
    public static void setPinkAgeText(String pinkAgeText) {
        SPUtils.getInstance().put(PINK_AGE_TEXT, pinkAgeText, true);
    }

    /**
     * 获取半屏广告地址
     * @return
     */
    public static String getPinkAgeText() {
        return SPUtils.getInstance().getString(PINK_AGE_TEXT, "免运费");
    }

    /**
     * 保存半屏广告地址
     * @param waitingPayTime
     */
    public static void setWaitingPayTime(float waitingPayTime) {
        SPUtils.getInstance().put(WAITING_PAY_TIME, waitingPayTime, true);
    }
    /**
     * 华为价格200时长显示控制
     * @return
     */
    public static boolean getHuaWeiTime() {
        long aLong = SPUtils.getInstance().getLong(HUA_WEI_TIME, 0);
        long l = System.currentTimeMillis();
        boolean b = (l - aLong) < 60 * 60 * 1000 * 2;
        return b;
    }

    /**
     * 保存半屏广告地址
     */
    public static void setHuaWeiTime() {
        long aLong = SPUtils.getInstance().getLong(HUA_WEI_TIME, 0);
        if (aLong <100){
            SPUtils.getInstance().put(HUA_WEI_TIME, System.currentTimeMillis(), true);
        }
    }

    /**
     * 获取半屏广告地址
     * @return
     */
    public static long getWaitingPayTime() {
        float aFloat = SPUtils.getInstance().getFloat(WAITING_PAY_TIME, 1f);
        return (long) aFloat;
    }

    /**
     * 保存半屏广告地址
     * @param switchWishImage
     */
    public static void setSwitchWishImage(String switchWishImage) {
        SPUtils.getInstance().put(SWITCH_WISH_IMAGE, switchWishImage, true);
    }

    /**
     * 获取半屏广告地址
     * @return
     */
    public static String getSwitchWishImage() {
        return SPUtils.getInstance().getString(SWITCH_WISH_IMAGE, "");
    }

    /**
     * 保存价格限制
     * @param limitBoxMoney
     */
    public static void setLimitBoxMoney(String limitBoxMoney) {
        SPUtils.getInstance().put(LIMIT_BOX_MONEY, limitBoxMoney, true);
    }

    /**
     * 获取价格上限
     * @return
     */
    public static int getLimitBoxMoney() {
        String string = SPUtils.getInstance().getString(LIMIT_BOX_MONEY, "1000");
        if (TextUtils.isEmpty(string))return 1000;
        return Integer.parseInt(string);
    }


    public static void setLoginFirst(boolean first) {
        SPUtils.getInstance().put(SPMANAGER_LOGIN_FIRST, first, true);
    }

    public static boolean getLoginFirst() {
        return SPUtils.getInstance().getBoolean(SPMANAGER_LOGIN_FIRST, false);
    }

    /**
     * true 打开推送 false  关闭  默认打开
     *
     * @return
     */
    public static boolean getPushState() {
        return SPUtils.getInstance().getBoolean(PUSH_STATE, true);
    }

    public static void setTime(long ovId) {
        SPUtils.getInstance().put(INIT_RE_YUN_T, ovId, true);
    }


    public static void setFirstOpenApp(boolean isFirst) {
        SPUtils.getInstance().put(FIRST_OPEN_APP, isFirst, true);
    }

    public static boolean getFirstOpenApp() {
        return SPUtils.getInstance().getBoolean(FIRST_OPEN_APP, true);
    }

    public static void setFirstDownMusic(boolean isFirst) {
        SPUtils.getInstance().put(FIRST_DOWN_MUSIC, isFirst, true);
    }

    public static boolean getFirstDownMusic() {
        return SPUtils.getInstance().getBoolean(FIRST_DOWN_MUSIC, true);
    }

    public static void setHomeMusicPath(String musicPath) {
        if (TextUtils.isEmpty(musicPath)) return;
        SPUtils.getInstance().put(HOME_MUSIC_PATH, musicPath, true);
    }

    public static String getHomeMusicPath() {
        return SPUtils.getInstance().getString(HOME_MUSIC_PATH, "");
    }

    /**
     * 对华为  oppo 控制
     *
     * @param isFirst
     */
    public static void setLimitPrice(boolean isFirst) {
        SPUtils.getInstance().put(LIMIT_PRICE, isFirst, true);
    }

    /**
     * 对华为  oppo 控制  true 打开  false  关闭  默认打开
     */
    public static boolean getLimitPrice() {
        return SPUtils.getInstance().getBoolean(LIMIT_PRICE, false);
    }


    /**
     * 是否打开 开关
     *
     * @return
     */
    public static boolean isOppoOpen() {
        if (BuildConfig.channelName.equals("oppo"))
            return !SPManager.getLimitPrice()  && getHuaWeiTime();
        else
            return false;
    }

    /**
     * 是否打开 华为 开关
     *
     * @return
     */
    public static boolean isHuaweiOpen() {
        if (BuildConfig.channelName.equals("huawei"))
            return !SPManager.getLimitPrice()  && getHuaWeiTime() ;
        else
            return false;
    }
    /**
     * 是否打开 华为 开关
     *
     * @return
     */
    public static boolean isHuaweiOpenButton() {
        if (BuildConfig.channelName.equals("huawei"))
            return !SPManager.getLimitPrice()   ;
        else
            return false;
    }

    public static boolean getTime() {
        long time = new Date().getTime();
        long aLong = SPUtils.getInstance().getLong(INIT_RE_YUN_T, 0l);
        boolean b = (time - aLong) > 5000;
        if (b) {
            setTime(time);
        }
        return b;
    }

    public static void setHuaWeiRule(String rule) {
        SPUtils.getInstance().put(HUA_WEI_RULE, rule, true);
    }

    public static String getHuaWeiRule() {
        return SPUtils.getInstance().getString(HUA_WEI_RULE, "<font color=\"#FF8827\">1．本平台禁止未成年消费。</font>\n"  +
                "2.开盒后不支持退款,但可8折回收后自动兑换成" + App.getInstance().getString(R.string.integral_name) + "用于兑换商品，"
                + App.getInstance().getString(R.string.integral_name) + "不支持提现。\n" +
                "3. 发货若不满足包邮规则将另支付20元邮费。\n" +
                "4．开盒必出盒中商品，商品抽奖存在概率性，付费请谨慎！");
    }

    public static void setShareImage(String url) {
        SPUtils.getInstance().put(SURPRISED_SHARE_IMAGS, url, true);
    }

    public static String getShareImage() {
        return SPUtils.getInstance().getString(SURPRISED_SHARE_IMAGS, "https://www.nairongmiao.xyz/shareH5.html");
    }

    public static void setShareSeckillImage(String url) {
        SPUtils.getInstance().put(SHARE_SECKILL_IMAGS, url, true);
    }

    public static void setCardEmptyImages(String url) {
        SPUtils.getInstance().put(CARD_EMPTY_IMAGES, url, true);
    }

    public static String getCardEmptyImages() {
        return SPUtils.getInstance().getString(CARD_EMPTY_IMAGES, "");
    }

    public static void setCouponEmptyImages(String url) {
        SPUtils.getInstance().put(COUPON_EMPTY_IMAGES, url, true);
    }

    public static String getCouponEmptyImages() {
        return SPUtils.getInstance().getString(COUPON_EMPTY_IMAGES, "");
    }

    public static void setSignEmptyImages(String url) {
        SPUtils.getInstance().put(SIGN_EMPTY_IMAGES, url, true);
    }

    public static String getSignEmptyImages() {
        return SPUtils.getInstance().getString(SIGN_EMPTY_IMAGES, "");
    }

    public static String getShareSeckillImags() {
        return SPUtils.getInstance().getString(SHARE_SECKILL_IMAGS, "https://www.nairongmiao.xyz/shareSeckill.html");
    }

    public static boolean getSwitchCoupon() {
        return SPUtils.getInstance().getBoolean(SWITCH_COUPON, true);
    }

    public static void setSwitchCoupon(boolean switchCoupon) {
        SPUtils.getInstance().put(SWITCH_COUPON, switchCoupon, true);
    }

    public static boolean getSwitchSign() {
        return SPUtils.getInstance().getBoolean(SWITCH_SIGN, true);
    }

    public static void setSwitchSign(boolean switchBox) {
        SPUtils.getInstance().put(SWITCH_SIGN, switchBox, true);
    }

    public static boolean getSwitchPicked() {
        return SPUtils.getInstance().getBoolean(SWITCH_PICKED, true);
    }

    public static void setSwitchPicked(boolean switchBox) {
        SPUtils.getInstance().put(SWITCH_PICKED, switchBox, true);
    }

    public static boolean getSwitchSurprised() {
        return SPUtils.getInstance().getBoolean(SWITCH_SURPRISED, true);
    }

    public static void setSwitchSurprised(boolean switchBox) {
        SPUtils.getInstance().put(SWITCH_SURPRISED, switchBox, true);
    }

    public static boolean getSwitchBox() {
        return SPUtils.getInstance().getBoolean(SWITCH_BOX, true);
    }

    public static void setSwitchBox(boolean switchBox) {
        SPUtils.getInstance().put(SWITCH_BOX, switchBox, true);
    }

    public static boolean getSwitchWish() {
        return SPUtils.getInstance().getBoolean(SWITCH_WISH, true);
    }

    public static void setSwitchWish(boolean switchBox) {
        SPUtils.getInstance().put(SWITCH_WISH, switchBox, true);
    }

    public static boolean getSwitchSeckill() {
        return SPUtils.getInstance().getBoolean(SWITCH_SECKILL, true);
    }

    public static void setSwitchSeckill(boolean switchBox) {
        SPUtils.getInstance().put(SWITCH_SECKILL, switchBox, true);
    }

}
